package com.du.back1.utills;

public class BaseResult {

    private String code;
    private String msg;
    private Object data;
    private static String error;

    public static BaseResult success() {
        BaseResult result = new BaseResult();
        result.setCode("200");
        result.setMsg("请求成功");
        return result;
    }

    public static BaseResult success(Object data) {
        BaseResult result = success();
        result.setData(data);
        return result;
    }

    public static BaseResult error() {
        BaseResult result = new BaseResult();
        result.setCode("500");
        result.setMsg("服务器错误");
        return result;
    }
    public static BaseResult error(String msg,String code) {
        BaseResult result = new BaseResult();
        result.setCode(code);
        result.setMsg(msg);
        return result;
    }


    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getError() {
        return error;
    }

    public void setError(String error) {
        BaseResult.error = error;
    }
}
